type Graph = number[][];

const graph = [
    [0, 8, 12, null, null, null, null, null],
    [8, 0, 13, 25, 9, null, null, null],
    [12, 13, 0, 14, 0, 0, 21, null],
    [null, 25, 14, 0, 20, 8, null, null],
    [null, 9, null, 20 ,null, 19, null, null],
    [null, null, null, 8, 19, null, 0, 11, null],
    [null, null, 21, 12, null, 0, null, 11],
    [null, null, null, 13,0, 11, 0, 0, 9],
    [null, null, null, null, 0, 11, 9, null]
]; 

 function makeGraph(n:number):Graph{
    const ret=[];
    for(let i=0;i<n;i++){
        ret.push(new Array(n).fill(0));
    }
    for(let i=0;i<n;i++){
        for(let j=i;j<n;j++){
            let t=Math.floor(Math.random()*10);
            ret[i][j]=t;
            ret[j][i]=t;
        }
    }
    return ret;
 }
 const t=makeGraph(5);
 console.log(t);
 function prim(graph:Graph){
    const n=graph.length;
    const visited=new Array(n).fill(false);
    for(let i=0;i<graph.length;i++){
       let min=Number.MAX_SAFE_INTEGER;

    }
 } 